package chapter06;

public class CloneTest implements Cloneable {
	public CloneTest getObject() throws CloneNotSupportedException {
		return (CloneTest) this.clone();
	}
	
	public static void main(String[] args) {
		CloneTest c1 = new CloneTest();
		CloneTest c2 = null;
		CloneTest c3 = null;
		CloneTest c4 = null;
		try {
			c2 = c1.getObject();
			c3 = (CloneTest) c1.clone();
			c4 = (CloneTest) c1.clone();

		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(c1);
		System.out.println(c2);
		System.out.println(c3);
		System.out.println(c4);
	}
}
